package com.my.hzb.user.mq;

import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;

import javax.jms.*;

public class MqSender {

	 private JmsTemplate jmsTemplate;
	 private String codeTopic;
	 private Topic topic;
	 
	 public void sendMessage(final String message) {
        jmsTemplate.send(new MessageCreator() {
            public Message createMessage(Session session) throws JMSException {
                return session.createTextMessage(message);
            }
        });
    }

	public JmsTemplate getJmsTemplate() {
		return jmsTemplate;
	}

	public void setJmsTemplate(JmsTemplate jmsTemplate) {
		this.jmsTemplate = jmsTemplate;
	}

	public String getCodeTopic() {
		return codeTopic;
	}

	public void setCodeTopic(String codeTopic) {
		this.codeTopic = codeTopic;
	}

	public Topic getTopic() {
		return topic;
	}

	public void setTopic(Topic topic) {
		this.topic = topic;
	}
	 
}
